import React, { useRef, useEffect, forwardRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

const TwoArmTrolley = forwardRef((props, ref) => {
  const { nodes, materials, animations } = useGLTF('/models/twoArmTrolley.glb')
  const { actions } = useAnimations(animations, ref)
  useEffect(() => {
    for (const k in actions) {
      actions[k].play()
    }
  }, [actions]);
  return (
    <group visible={false} ref={ref} scale={0.001} dispose={null} >
      <group scale={0.6} position={[-4.8, -0.2, 0]}>
        <line geometry={nodes.curve11.geometry} material={nodes.curve11.material} position={[1.399985, -0.713208, -1.25434]} />
        <mesh geometry={nodes.pCube20.geometry} material={materials.PaletteMaterial001} position={[1.166575, -0.015767, -1.215043]} scale={3.176027} />
        <instancedMesh args={[nodes.mesh_1.geometry, materials.PaletteMaterial001, 5]} instanceMatrix={nodes.mesh_1.instanceMatrix} />
      </group>
    </group>
  )
})

useGLTF.preload('/models/twoArmTrolley.glb')

export default TwoArmTrolley;
